package com.ruoyi.jx.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.jx.domain.MemberBalanceRecordVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.jx.mapper.MemberBalanceRecordMapper;
import com.ruoyi.jx.domain.MemberBalanceRecord;
import com.ruoyi.jx.service.IMemberBalanceRecordService;

/**
 * 会员余额Service业务层处理
 * 
 * @author p
 * @date 2021-10-07
 */
@Service
public class MemberBalanceRecordServiceImpl implements IMemberBalanceRecordService 
{
    @Autowired
    private MemberBalanceRecordMapper memberBalanceRecordMapper;

    /**
     * 查询会员余额
     * 
     * @param id 会员余额ID
     * @return 会员余额
     */
    @Override
    public MemberBalanceRecord selectMemberBalanceRecordById(Long id)
    {
        return memberBalanceRecordMapper.selectMemberBalanceRecordById(id);
    }

    /**
     * 查询会员余额列表
     * 
     * @param memberBalanceRecord 会员余额
     * @return 会员余额
     */
    @Override
    public List<MemberBalanceRecord> selectMemberBalanceRecordList(MemberBalanceRecord memberBalanceRecord)
    {
        return memberBalanceRecordMapper.selectMemberBalanceRecordList(memberBalanceRecord);
    }

    @Override
    public List<MemberBalanceRecordVO> selectMemberBalanceRecordListMap(Map<String, Object> params) {
        return memberBalanceRecordMapper.selectMemberBalanceRecordListMap(params);
    }

    /**
     * 新增会员余额
     * 
     * @param memberBalanceRecord 会员余额
     * @return 结果
     */
    @Override
    public int insertMemberBalanceRecord(MemberBalanceRecord memberBalanceRecord)
    {
        memberBalanceRecord.setCreateTime(DateUtils.getNowDate());
        return memberBalanceRecordMapper.insertMemberBalanceRecord(memberBalanceRecord);
    }

    /**
     * 修改会员余额
     * 
     * @param memberBalanceRecord 会员余额
     * @return 结果
     */
    @Override
    public int updateMemberBalanceRecord(MemberBalanceRecord memberBalanceRecord)
    {
        memberBalanceRecord.setUpdateTime(DateUtils.getNowDate());
        return memberBalanceRecordMapper.updateMemberBalanceRecord(memberBalanceRecord);
    }

    /**
     * 批量删除会员余额
     * 
     * @param ids 需要删除的会员余额ID
     * @return 结果
     */
    @Override
    public int deleteMemberBalanceRecordByIds(Long[] ids)
    {
        return memberBalanceRecordMapper.deleteMemberBalanceRecordByIds(ids);
    }

    /**
     * 删除会员余额信息
     * 
     * @param id 会员余额ID
     * @return 结果
     */
    @Override
    public int deleteMemberBalanceRecordById(Long id)
    {
        return memberBalanceRecordMapper.deleteMemberBalanceRecordById(id);
    }
}
